home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7837 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.PBI.net!usenet
  2. From: mich@pbinet.com
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Arrays of strings
  5. Date: 29 Feb 1996 05:00:15 GMT
  6. Organization: Pacific Bell Internet Services
  7. Message-ID: <4h3bsv$s24@SNFC21_SRVR_WWW.PBI.net>
  8. References: <4g3625$f0m@jaxnet.jaxnet.com>
  9. Reply-To: mich@pbinet.com
  10. NNTP-Posting-Host: ppp-5-39.rdcy01.pbinet.com
  11. X-Newsreader: IBM NewsReader/2 v1.03
  12.  
  13. >Larry DiGiovanni (ldigiova@nova.umuc.edu) wrote:
  14.  
  15. >: I'm trying to read lines of a text file and load those lines into an 
  16. >: array.  I have a couple of questions...
  17. >: 1.  How do I declare the array to contain the text.  When it is declared, 
  18. >: I will not know how many lines are in the text file.  char **txtarray?
  19.  
  20. >Yes, that can work. "char **txtarray;" now is an uninitialized pointer
  21. >of pointers to character arrays <I hope I stated that correctly>.
  22.  
  23. Just as a point of note; I have successfully used both a pointer to a large
  24. (pre-malloced, of course) buffer of type char and an array of pointers to
  25. lesser sized char buffers to achieve this. Standard C stuff, really. Arrays
  26. of pointers to buffers seem to work well for word processing type
  27. applications.
  28.  
  29.